home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Samples / Managed / Direct3D / CustomUI / CustomUI.fx < prev    next >
Encoding:
Text File  |  2004-09-27  |  1.5 KB  |  54 lines

  1. //--------------------------------------------------------------------------------------
  2. // File: CustomUI.fx
  3. //
  4. // The effect file for the CustomUI sample.  
  5. // 
  6. // Copyright (c) Microsoft Corporation. All rights reserved.
  7. //--------------------------------------------------------------------------------------
  8.  
  9.  
  10. //--------------------------------------------------------------------------------------
  11. // Global variables
  12. //--------------------------------------------------------------------------------------
  13. float4x4 worldMatrix;                    // World matrix for object
  14. float4x4 worldViewProjection;    // World * View * Projection matrix
  15. texture  sceneTexture;
  16.  
  17. sampler  g_samScene =
  18. sampler_state
  19. {
  20.     Texture = <sceneTexture>;
  21.     MinFilter = Linear;
  22.     MagFilter = Linear;
  23.     MipFilter = Point;
  24. };
  25.  
  26.  
  27. void VertScene( float4 Pos : POSITION,
  28.                 float2 Tex : TEXCOORD0,
  29.                 out float4 oPos : POSITION,
  30.                 out float2 oTex : TEXCOORD0 )
  31. {
  32.     oPos = mul( Pos, worldViewProjection );
  33.     oTex = Tex;
  34. }
  35.  
  36.  
  37. float4 PixScene( float2 Tex : TEXCOORD0 ) : COLOR0
  38. {
  39.     return tex2D( g_samScene, Tex );
  40. }
  41.  
  42.  
  43. //--------------------------------------------------------------------------------------
  44. // Techniques
  45. //--------------------------------------------------------------------------------------
  46. technique RenderScene
  47. {
  48.     pass P0
  49.     {
  50.         VertexShader = compile vs_1_1 VertScene();
  51.         PixelShader = compile ps_1_1 PixScene();
  52.     }
  53. }
  54.